﻿<Window x:Class="P2.Cuberry.Modules.Framework.UserGroup.UserGroupSpecialRightView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
         
        
    Height="600" Width="900"
    Title="Peacequare Cuberry" 
        Background="{DynamicResource P2BackgroundBrush}" Icon="/P2.Cuberry.Modules.Framework.UserGroup;component/Images/CuberryIcon32.ico">
                <Window.Resources>
    <ResourceDictionary>
        <ResourceDictionary.MergedDictionaries>
            <ResourceDictionary Source="/P2.Cuberry.Framework.Layout;component/Styles/Styles.xaml"/>
            <ResourceDictionary Source="/P2.Cuberry.Framework.Layout;component/Styles/CuberryDataGrid.xaml"/>
        </ResourceDictionary.MergedDictionaries>
    </ResourceDictionary>
    </Window.Resources>

    <Grid >
<Grid.Resources>
                <Image x:Key="FindIcon" Height="16" Width="16" Source="/P2.Cuberry.Modules.Framework.UserGroup;component/Images/find16.gif" />
                <Image x:Key="RefreshIcon" Height="16" Width="16" Source="/P2.Cuberry.Modules.Framework.UserGroup;component/Images/refresh16.gif" />

        </Grid.Resources>

        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>

        <Grid.RowDefinitions>
            <RowDefinition Height="40" />
            <RowDefinition Height="35" />
            <RowDefinition Height="*"/>
            <RowDefinition Height="35" />
        </Grid.RowDefinitions>

        <!-- Row 0 Start -->
        
        <Label Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="3" Margin="0,0,0,0" Content="User Group Special Rights" Style="{StaticResource P2DetailViewHeaderTextStyle}" />
        <Label Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="3" Margin="280,0,0,0" Content="{Binding ModuleName}" Style="{StaticResource P2DetailViewHeaderTextStyle}" />

        <Separator Margin="0,0,0,0" Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="3" VerticalAlignment="Bottom" Height="0"/>
        <!-- Row 0 End -->

        <!-- Row 1: Menu Start -->
        <Border  Grid.Row="1" Grid.Column="0"  Style="{StaticResource P2MenuBorderStyle}">
            <StackPanel Orientation="Horizontal" >                
                <Label Margin="3,2,1,0" Height="23" Name="DialogNameL" VerticalAlignment="Top" HorizontalAlignment="Left" Width="90" Content="{Translate DialogNameL}" />
                <ComboBox Margin="3,2,1,0" Name="DialogName" Height="23" Width="120" ItemsSource="{Binding DialogNames}" SelectedIndex="0" HorizontalAlignment="Left"  VerticalAlignment="Top" Style="{StaticResource P2ComboBoxStyle}"/>                
                
                <Label Margin="3,2,1,0" Height="23" Name="ControlNameL" VerticalAlignment="Top" HorizontalAlignment="Left" Width="90" Content="{Translate ControlNameL}" />
                <ComboBox Margin="3,2,1,0" Name="ControlName" Height="23" Width="120" ItemsSource="{Binding ControlNames}" SelectedIndex="0" HorizontalAlignment="Left"  VerticalAlignment="Top" Style="{StaticResource P2ComboBoxStyle}"/>
                
                <Label Margin="3,2,1,0" Height="23" Name="AccessRightL" VerticalAlignment="Top" HorizontalAlignment="Left" Width="79" Content="{Translate AccessRightL}" />
                <ComboBox Margin="3,2,1,0" Name="AccessRight" Height="23" Width="70" ItemsSource="{Binding AccessRights}" SelectedIndex="1" HorizontalAlignment="Left"  VerticalAlignment="Top" Style="{StaticResource P2ComboBoxStyle}"/>

                <Label Margin="3,2,1,0" Height="23" Name="StatusL" VerticalAlignment="Top" HorizontalAlignment="Left" Width="59" Content="{Translate StatusL}" />
                <ComboBox Margin="3,2,1,0" Name="Status" Height="23" Width="70" ItemsSource="{Binding WorkflowStatusses}" SelectedValuePath="StatusID" DisplayMemberPath="StatusNameCur" SelectedIndex="1" HorizontalAlignment="Left"  VerticalAlignment="Top" Style="{StaticResource P2ComboBoxStyle}"/>

                <Button Height="23" HorizontalAlignment="Right" Margin="3,2,1,0" Name="FindButton" Click="FindButton_Click" VerticalAlignment="Top" Width="25">
                    <Image  Source="/P2.Cuberry.Modules.Framework.UserGroup;component/Images/add.png"></Image>
                </Button>
                <Button Height="23" HorizontalAlignment="Right" Margin="3,2,1,0" Name="DeleteButton" Click="DeleteButton_Click" VerticalAlignment="Top" Width="25">
                    <Image  Source="/P2.Cuberry.Modules.Framework.UserGroup;component/Images/Remove.ico"></Image>
                </Button>

            </StackPanel>
        </Border>
        <!-- Row 1 End -->
        <!-- Row 2: All Fields -->
        <Border  Grid.Row="2" Grid.Column="0"  Style="{StaticResource P2ContentBorderStyle}">
            <Grid >
                <DataGrid Grid.Row="2" Margin="3,0,3,0" 
                             Name="UserGroupSpecialRightsList" 
                             ItemsSource="{Binding UserGroupSpecialRightItems}" 
                             Style="{DynamicResource CuberryDataGridStyle}"
                             VerticalAlignment="Top" >
                    <DataGrid.Columns>
                        
                        <DataGridTextColumn Header="{Translate DialogNameL}" Binding="{Binding Path=DialogName, StringFormat=F2}" IsReadOnly="True" Width="220" MinWidth="100" />
                        <DataGridTextColumn Header="{Translate ControlNameL}" Binding="{Binding Path=ControlName}" IsReadOnly="True" Width="220" MinWidth="100"/>
                        <DataGridTextColumn   Header="{Translate AccessRightL}" IsReadOnly="True"  Binding="{Binding AccessRight}" Width="150" MinWidth="20" />
                        <DataGridTextColumn   Header="{Translate StatusL}" IsReadOnly="True"  Binding="{Binding StatusName}" Width="*" MinWidth="20" />

                    </DataGrid.Columns>
                </DataGrid>
            </Grid>
        </Border>

    </Grid>
</Window>
